/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import entity.ProductQuantityPriceEntity;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;

/**
 *
 * @author wei
 */
public class PQPEntityListener {

    public PQPEntityListener() {
    }

    @PreUpdate
    public void preUpdate(ProductQuantityPriceEntity pqp) {
        pqp.calculatePricePerUnit();
    }

    @PrePersist
    public void prePersist(ProductQuantityPriceEntity pqp) {
        pqp.calculatePricePerUnit();
    }
}
